<?php
class Mongo {

	protected $db;
	protected $app;

	private function __construct(){
		$this->app = Basic::app();
		$config = $this->app->getConfigs();
		$m_config = $config['db']['mongo'];
		$m = new Mongo($m_config['server'],$m_config['params']);
		$this -> db = $m->selectDB($m['dbname']);
	}



	public function insert($collection, $data){
		$collection = $this -> db ->selectCollection($collection);
		$collection -> insert($data);
		return json_decode($collection);
	}
}